﻿<template>
  <div class="bg_get_msg_container">
    <div class="bg_get_msg_main clearfix" style="position:relative;">
        <textarea class="inerr" placeholder="冒险考验" ref="texta">

        </textarea>
    </div>
    <div class="next_box clearfix">
      <div class="next_btn_base" v-on:click="pre_btn">
       上一步
      </div>
      <div class="next_btn_base" v-on:click="finish">
        完成
      </div>
    </div>
  </div>
</template>
<script>
  import {mapState, mapMutations,mapActions,mapGetters} from 'vuex';
  import common from "../../common/common.js";
  import { DatetimePicker } from 'mint-ui';
  //limit_Scroll
  //import limit_scroll from "../../static/js/limit_scroll.js"
  const qs = require('qs');
  import  filter from "../../filter/filter.js"
  //axios.post('/foo', qs.stringify({ 'bar': 123 }));

export default {
  name: 'bg_get_img',
  data () {
    return {
      startDate:"",
      pickerValue:"",
    }
  },
  created:function () {
      let now_year = new Date();
      this.startDate = new Date(now_year.getFullYear().toString())
  },
  watch: {
    pickerValue: function (val) {
      if( typeof(this.pickerValue) != "object")return;
      this.pickerValue = this.pickerValue.getFullYear()+ "-" + (this.pickerValue.getMonth()+1) + "-" + this.pickerValue.getDate()
    },
  },
  methods: {
    openPicker() {
      this.$refs.picker.open();
    },
    handleConfirm(e){
      this.$refs.picker.close()
    },
    pre_btn:function () {
      common.go_back_none_btn();
    },
    finish:function () {
      let texta = this.$refs.texta.value;
      this.$store.commit("set_B_M",{commit:texta,finish:true});
//      console.log(this.$store.getters.get_B_M);
     console.log("finish")
      console.log(!!localStorage.getItem("limit_card_type"))
      if( !!localStorage.getItem("limit_card_type")){//用limit card type 判断是不是 限定卡
        this.$store.dispatch("thom_redirect",
          { name: "/input_limit_card", router: this.$router })
      }else{//这是 冒险卡
        this.$store.dispatch("thom_redirect",
          { name: "/Advanture", router: this.$router })
      }

    }
  },
  components: {

  }
}
</script>
<style scoped lang="scss">
 @import "../../../static/sass/thom_c_size.scss";
 @import "../sass/bg_get_msg_container.scss";
 @import "../sass/bg_get_msg_m.scss";
</style>
